// frontend/src/App.js
import { BrowserRouter, Routes, Route, Navigate } from 'react-router-dom';
import Login from './pages/Login';
import Dashboard from './pages/Dashboard';
import DeviceList from './pages/DeviceList';
import Simulation from './pages/Simulation';

function App() {
    return (
        <BrowserRouter>
            <Routes>
                <Route path="/login" element={<Login />} />
                <Route path="/dashboard" element={
                    <ProtectedRoute>
                        <Dashboard />
                    </ProtectedRoute>
                } />
                <Route path="/devices" element={
                    <ProtectedRoute>
                        <DeviceList />
                    </ProtectedRoute>
                } />
                <Route path="/simulation/:deviceId" element={
                    <ProtectedRoute>
                        <Simulation />
                    </ProtectedRoute>
                } />
            </Routes>
        </BrowserRouter>
    );
}
